// pages/success/success.js
var app = getApp();
var host = app.globalData.host;
var self = null;

Page({
  data: {
    themeColor: '',
    notice: '',
    isShowContent: 0,
    isFromMore: 0
  },
  onLoad: function (options) {
    self = this
    self.getStyle()
    self.setData({
      isShowContent: options.isShowContent ? parseInt(options.isShowContent) : 0,
      notice: app.globalData.notice ? app.globalData.notice : '',
      isFromMore: options.isFromMore ? parseInt(options.isFromMore) : 0
    })
  },
  getStyle() {
    wx.setNavigationBarTitle({
      title: '购买成功'
    })
    self.setData({
      themeColor: app.globalData.themeColor
    })
  },
  home() {
    var currentPages = getCurrentPages();
    if (currentPages.length > 1 && currentPages[currentPages.length - 2].init) {
      currentPages[currentPages.length - 2].init();
    }
    wx.navigateBack({
      // delta: self.data.isFromMore === 1 ? 2 : 1
      delta: 1
    })
  }
})